//
//  ItemDetailScrollView.m
//  DanTang
//
//  Created by honeyrr on 2017/9/24.
//  Copyright © 2017年 honeyrr. All rights reserved.
//

#import "ItemDetailScrollView.h"
#import "ItemDetailTopView.h"
#import "ItemDetailBottomView.h"

@interface ItemDetailScrollView()

@property(nonatomic, strong) ItemDetailTopView *topView;
@property(nonatomic, strong) ItemDetailBottomView *bottomView;

@end

@implementation ItemDetailScrollView

#pragma mark - 重写initWithFrame方法
-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self addSubview:self.topView];
        [self addSubview:self.bottomView];
    }
    return self;
}

#pragma mark - 懒加载
-(ItemDetailTopView *)topView
{
    if (!_topView) {
        ItemDetailTopView *topView = [[ItemDetailTopView alloc]initWithFrame:CGRectMake(0, 0, DTScreenW, 520)];
        topView.backgroundColor = [UIColor whiteColor];
        _topView = topView;
    }
    return _topView;
}
-(ItemDetailBottomView *)bottomView
{
    if (!_bottomView) {
        ItemDetailBottomView *bottomView = [[ItemDetailBottomView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_topView.frame) + 10, DTScreenW, DTScreenH - 64 - 45)];
        bottomView.backgroundColor = [UIColor whiteColor];
        _bottomView = bottomView;
    }
    return _bottomView;
}


-(void)setItem:(NSDictionary *)item
{
    _item = item;
    _topView.item = item;
    _bottomView.item = item;
}

@end
